package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.domain.TravelTemplate;
import cn.wolfcode.luowowo.search.qo.IndexSearchQo;
import cn.wolfcode.luowowo.search.repository.ITravelTemplateRepository;
import cn.wolfcode.luowowo.search.service.ISearchService;
import cn.wolfcode.luowowo.search.service.ITravelTemplateService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;

@Service
public class TravelTemplateServiceImpl implements ITravelTemplateService {

    @Autowired
    private ITravelTemplateRepository travelTemplateRepository;
    @Autowired
    private ISearchService searchService;

    @Override
    public Page queryWithHighlight(IndexSearchQo qo) {

        return searchService.searchWithHighlight(qo.getIndex(),qo.getTrueType(), TravelTemplate.class,qo,"title","summary");
    }

    @Override
    public void save(TravelTemplate template) {
        travelTemplateRepository.save(template);
    }
}
